Adds a specified value at the end of an array, returning the adjusted array.
#include <Array.au3>
_ArrayAdd ( $avArray, $sValue )
Parameters
$avArray | The array to which the element is to be added. |
$sValue | The value to be added. |
Return Value
Success: | Returns 1 and the modified array. |
Failure: | Returns a 1-element array with the value added to it. |
@Error: | 0 = No error. |
1 = $avArray isn't an array. |
Remarks
This function will return an array even if both parameters are empty strings (""). In this case it will return an array with 1-element that contains an empty string value.
Related
_ArrayDelete, _ArrayInsert
Example
#include <Array.au3>
Dim $avArray[10]
$avArray[0] = "JPM"
$avArray[1] = "Holger"
$avArray[2] = "Jon"
$avArray[3] = "Larry"
$avArray[4] = "Jeremy"
$avArray[5] = "Valik"
$avArray[6] = "Cyberslug"
$avArray[7] = "Nutster"
$avArray[8] = "JdeB"
$avArray[9] = "Tylo"
_ArrayDisplay( $avArray, "Whole array" )
_ArrayAdd( $avArray,"Brian")
_ArrayDisplay( $avArray, "Updated Array" )